#include <stdio.h>

int main()
{
    int n;
    while (scanf_s("%d", &n) != EOF)
    {
        for (int i = 1; i <= n; i++)
        {
            for (int j = 2; j <=n; j++)
            {
   

                if (i == n || i  == 1)
                {            
                      printf("* "); 
                      if(j == n)
                      printf("* \n");
                }
                else
                {
                    if (j == 2)
                    {
                        printf("* ");
                    }
                    if (j == n)
                    {
                        printf("* \n");
                    }
                    else
                    {
                        printf("  ");
                    }
                
                }

            }
               
        }

     }
        return 0;
}
       
    

   
